package com.mallfeign.controller;

import com.mallfeign.feign.ITestFeign;
import feign.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: where
 * @Date: 2022/07/21/15:55
 * @Description:
 */
@RestController("feign")
@RequestMapping("/feign")
@ResponseBody
public class TestOpenFeign {
    @Autowired
    private ITestFeign iTestFeign;

//    @PostMapping(path="remote01")
//    public String test01() {
//        return "success";
//    }
//
//    @GetMapping
//    public String test03() {
//        return "success";
//    }

    @GetMapping(path="remote02/{id}")
    public String test02 (@PathVariable("id") int id) {
        System.out.println(iTestFeign.test01(id));
        return "success";
    }

    @PostMapping
    public String post() {
        return iTestFeign.postTest();
    }


//    @GetMapping(path="/remote04/{id}")
//    public String test04 (int id) {
//        System.out.println(iTestFeign.test01(id));
//        return "success";
//    }
}
